.TH std::once_flag 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::once_flag \- std::once_flag

.SH Synopsis
   Defined in header <mutex>
   class once_flag;           \fI(since C++11)\fP

   The class std::once_flag is a helper structure for std::call_once.

   An object of type std::once_flag that is passed to multiple calls to std::call_once
   allows those calls to coordinate with each other such that only one of the calls
   will actually run to completion.

   std::once_flag is neither copyable nor movable.

.SH Member functions

std::once_flag::once_flag

   constexpr once_flag() noexcept;

   Constructs an once_flag object. The internal state is set to indicate that no
   function has been called yet.

.SH Parameters

   \fI(none)\fP

.SH See also

   call_once invokes a function only once even if called from multiple threads
   \fI(C++11)\fP   \fI(function template)\fP
   C documentation for
   once_flag
